$(function(){
	var p=1;
	function list_qb(p){
		$.ajax({
		    type:"post",
		    url:url+'/user/myteam.html?token='+token,
		    async:false,
		    data:{'token':token,"page":p},
		    dataType:'json',
		    success:function(result){
		        console.log(result)
		        if(result.status === "0001"){
					var data=result.data;
					var html ='';
					for(var i in data){
						html += '<li class="myteam_item"><img src="'+data[i].icon+'" alt="" class="myteam_pic" /><p class="myteam_le">';
						html += '会员账号：'+data[i].username+'<br />姓名：'+data[i].truename+'<br />等级：'+data[i].grade_name+'<br />直推人数：'+data[i].down_count_tj+'<br />团队算力：'+data[i].down_total_cash+'';
						html += '</p><a style="cursor:pointer;" onclick="javascript:mass(this);" class="myteam_link" data-id="'+data[i].id+'">查看团队</a></li>';
					}
					if (html == "" || data.length < 10) {
						$('.notMore').css('display',"block")
					}
		        	$(".myteam_list").append(html);
		        }else{
		            isErr(result);
		            //location.href="../my.html";		            
		        }
		    },
			error:function(){
				layer.msg("响应失败");
			}
		})
	}
	list_qb(1);
	//	下拉加载更多
	$(window).scroll(function() {
		if ($(document).scrollTop() >= $(document).height() - $(window).height() - 70) {			
		// console.log('我到底了');
			if ($('.notMore').css('display') != "block") {
				p++;
				list_qb(p);
			}
		}
	})
})
function mass(d){
  location.href="my_team2.html?mid="+$(d).attr("data-id");
}
	

